import logging

from common.exchanges import DeribitPriService, Exchange
from common.exchanges.manager import ExchangeServiceManager
from common.helper import init_log
from common.models.account import Account
from common.utils.encrypt import AESEncryptor
from web import settings
from web.app import app, init_app

ExchangeServiceManager.config(env='test', logger=logging.root)
init_app(es=False)
init_log()


deribit_account = Account(
    exchange=Exchange.DERIBIT,
    api_key=AESEncryptor.encode('c5KuWeL6', settings.SECRET),
    api_secret=AESEncryptor.encode('GwLmv-Yujahr-_s2dBUOsbMpEpaPKY9PdJ1YK4JDSwc', settings.SECRET),
)


binance_account = Account(
    exchange=Exchange.BINANCE,
    api_key=AESEncryptor.encode('986b55aabc495d619ea3713825a93cb63d49f8e0231c44db41ddabe6aa7bb590', settings.SECRET),
    api_secret=AESEncryptor.encode('f38d259ff324ac9852e57a848318cf310758fa97fd923f25d072830de237e378', settings.SECRET),
)

ExchangeServiceManager.init_pub_service(
    settings.SUPPORT_EXCHANGES, settings.SUPPORT_BASE_CURRENCIES, settings.SUPPORT_MARGIN_CURRENCIES
)
